﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XNAGuiLib
{
    public class InterfaceObjectContainer : DrawableGameComponent
    {

        protected List<InterfaceObject> _ios = new List<InterfaceObject>();

        public InterfaceObjectContainer(Game game) : base (game)
        {

        }


        #region Public Method - Add(InterfaceObject item)
        public void Add(InterfaceObject item)
        {
            _ios.Add(item);
        }
        #endregion

        #region Public Method - Remove(InterfaceObject item)
        public void Remove(InterfaceObject item)
        {
            _ios.Remove(item);
        }
        #endregion

        #region Virtual Method - Draw(GameTime gameTime, SpriteBatch sprite)
        public virtual void Draw(GameTime gameTime, SpriteBatch sprite)
        {
            foreach (InterfaceObject io in _ios)
            {
                io.Draw(gameTime, sprite);
            }
        }
        #endregion
    }
}
